# -*- coding:utf-8 -*-

__author__ = 'Kalyugin Pavel'

from selenium import webdriver
import pytest
from HW_PO.Models.Application import Application


@pytest.fixture
def app(request, browser_type, base_url):
    if browser_type == "firefox":
        driver = webdriver.Firefox()
    elif browser_type == "chrome":
        driver = webdriver.Chrome()

    driver.implicitly_wait(10)

    request.addfinalizer(driver.quit)
    return Application(driver, base_url)
